%#define LOGINLENGTH 50
%#define HEADERLENGTH 256
%#define BODYLENGTH 1024

struct em_authr {
  unsigned int nsip;
  char username[LOGINLENGTH];
  char password[LOGINLENGTH];
};

struct em_readParam {
  em_authr authr;
  unsigned int letterId;
};

struct em_sendLetterParam {
  em_authr authr;
  char header[HEADERLENGTH];
  char body[BODYLENGTH];
};

struct em_getNextSubjectRes {
  unsigned int code;
  char header[HEADERLENGTH];
};

struct em_readLetterRes {
  unsigned int code;
  char body[BODYLENGTH];
};

program EM_PROG {
  version EM_VER {
    em_getNextSubjectRes _getNextSubject(em_readParam param) = 1;
    em_readLetterRes _readLetter(em_readParam param) = 2;
    unsigned int _sendLetter(em_sendLetterParam param) = 3;
    unsigned int _expandMail(em_authr) = 4;
  } = 1;
} = 32700005;
